from selenium.webdriver.common.keys import Keys

from Case.python_ui.Common.basepage import Basepage
from selenium.common.exceptions import StaleElementReferenceException
import time,pytest

from Case.python_ui.PageLocate.admin_team_ticket_loactor import AdminTeamTicketLocator
from Case.python_ui.PageLocate.admin_ticket_management_locator import AdminTicketManagementLocator

class AdminTicketManagementPage(Basepage):


    #进入ticket management菜单页面
    def  enter_ticket_management_page(self):
        time.sleep(2)
        doc = "进入ticket management菜单"
        for i in range(3):
            try:
                self.wait_elevisble(AdminTicketManagementLocator.dashboard_tab,doc)
                self.click_element(AdminTicketManagementLocator.dashboard_tab,doc)
                time.sleep(1)
                self.wait_elevisble(AdminTicketManagementLocator.bill_tab, doc)
                self.click_element(AdminTicketManagementLocator.bill_tab, doc)
                time.sleep(1)
                self.wait_elevisble(AdminTicketManagementLocator.ticket_management_tab,doc)
                self.click_element(AdminTicketManagementLocator.ticket_management_tab,doc)
                break
            except:
                self.driver.refresh()
                time.sleep(5)
                continue

    #Ticket Management页面新增内容
    def view_ticket_management_page(self):
        self.enter_ticket_management_page()
        time.sleep(2)
        doc = "Ticket Management页面新增内容"
        self.wait_elevisble(AdminTicketManagementLocator.aas_tab,doc)
        aas = self.get_element(AdminTicketManagementLocator.aas_tab,doc).text
        assert aas == "Auto-Assignment settings"
        self.wait_elevisble(AdminTicketManagementLocator.aos_tab,doc)
        aos = self.get_element(AdminTicketManagementLocator.aos_tab,doc).text
        assert aos == "Aging of SLA"
        self.wait_elevisble(AdminTicketManagementLocator.sbn_tab,doc)
        sbn = self.get_element(AdminTicketManagementLocator.sbn_tab,doc).text
        assert sbn == "SLA-Based notification"

    #编辑Auto-Assignment settings
    def eidt_aas(self):
        self.enter_ticket_management_page()
        time.sleep(2)
        doc = "编辑Auto-Assignment settings"
        self.wait_elevisble(AdminTicketManagementLocator.edit_button,doc)
        self.click_element(AdminTicketManagementLocator.edit_button,doc)
        self.wait_elevisble(AdminTicketManagementLocator.auto_assigenment_switch,doc)
        auto_assign_status = self.get_element(AdminTicketManagementLocator.auto_assigenment_switch,doc).get_attribute("aria-checked")
        if(auto_assign_status == "true"):
            #执行关闭auto
            self.click_element(AdminTicketManagementLocator.auto_assigenment_switch,doc)
            self.wait_elevisble(AdminTicketManagementLocator.auto_assigenment_switch_confirm,doc)
            self.click_element(AdminTicketManagementLocator.auto_assigenment_switch_confirm,doc)
        else:
            #执行开启
            self.click_element(AdminTicketManagementLocator.auto_assigenment_switch,doc)
        self.wait_elevisble(AdminTicketManagementLocator.ticket_amount_limitation,doc)
        self.send_keys(AdminTicketManagementLocator.ticket_amount_limitation,Keys.CONTROL + "a",doc)
        self.send_keys(AdminTicketManagementLocator.ticket_amount_limitation,Keys.DELETE,doc)
        self.send_keys(AdminTicketManagementLocator.ticket_amount_limitation, 8,doc)
        time.sleep(2)
        self.wait_elevisble(AdminTicketManagementLocator.submit_button,doc)
        self.click_element(AdminTicketManagementLocator.submit_button,doc)
        time.sleep(2)
        self.wait_elevisble(AdminTicketManagementLocator.ticket_amount_limitation_view,doc)
        amount = self.get_element(AdminTicketManagementLocator.ticket_amount_limitation_view,doc).text
        assert amount == "8"
        self.wait_elevisble(AdminTicketManagementLocator.auto_assigenment_switch_view,doc)
        status = self.get_element(AdminTicketManagementLocator.auto_assigenment_switch_view,doc).get_attribute("aria-checked")
        if (auto_assign_status == "true"):
            assert status == "false"
        else:
            assert status == "true"

    #编辑Aging of SLA
    def eidt_aos(self):
        self.enter_ticket_management_page()
        time.sleep(2)
        doc = "编辑Aging of SLA"
        self.wait_elevisble(AdminTicketManagementLocator.aos_tab,doc)
        self.click_element(AdminTicketManagementLocator.aos_tab,doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button,doc)
        self.click_element(AdminTicketManagementLocator.edit_button,doc)

        self.wait_elevisble(AdminTicketManagementLocator.high_response_time_day,doc)
        self.click_element(AdminTicketManagementLocator.high_response_time_day,doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.high_response_time_day,doc)
        self.keyboard_event(AdminTicketManagementLocator.high_response_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.high_response_time_day,1,doc)

        self.click_element(AdminTicketManagementLocator.high_response_time_hour, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.high_response_time_hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.high_response_time_hour, doc)
        self.send_keys(AdminTicketManagementLocator.high_response_time_hour, 1,doc)

        self.click_element(AdminTicketManagementLocator.high_response_time_min, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.high_response_time_min, doc)
        self.keyboard_event(AdminTicketManagementLocator.high_response_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.high_response_time_min, 1,doc)

        self.click_element(AdminTicketManagementLocator.high_processing_time_day, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.high_processing_time_day, doc)
        self.keyboard_event(AdminTicketManagementLocator.high_processing_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.high_processing_time_day, 1,doc)

        self.click_element(AdminTicketManagementLocator.high_processing_time_hour, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.high_processing_time_hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.high_processing_time_hour, doc)
        self.send_keys(AdminTicketManagementLocator.high_processing_time_hour, 1,doc)

        self.click_element(AdminTicketManagementLocator.high_processing_time_min, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.high_processing_time_min, doc)
        self.keyboard_event(AdminTicketManagementLocator.high_processing_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.high_processing_time_min, 1,doc)

        self.click_element(AdminTicketManagementLocator.medium_response_time_day, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.medium_response_time_day, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_response_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.medium_response_time_day, 1,doc)

        self.click_element(AdminTicketManagementLocator.medium_response_time_hour, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.medium_response_time_hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_response_time_hour, doc)
        self.send_keys(AdminTicketManagementLocator.medium_response_time_hour, 1,doc)

        self.click_element(AdminTicketManagementLocator.medium_response_time_min, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.medium_response_time_min, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_response_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.medium_response_time_min, 1,doc)

        self.click_element(AdminTicketManagementLocator.medium_processing_time_day, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.medium_processing_time_day, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_processing_time_day,doc)
        self.send_keys(AdminTicketManagementLocator.medium_processing_time_day,1,doc)

        self.click_element(AdminTicketManagementLocator.medium_processing_time_hour, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.medium_processing_time_hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_processing_time_hour,doc)
        self.send_keys(AdminTicketManagementLocator.medium_processing_time_hour,1,doc)

        self.click_element(AdminTicketManagementLocator.medium_processing_time_min, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.medium_processing_time_min, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_processing_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.medium_processing_time_min, 1,doc)

        self.click_element(AdminTicketManagementLocator.low_response_time_day, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.low_response_time_day, doc)
        self.keyboard_event(AdminTicketManagementLocator.low_response_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.low_response_time_day, 1,doc)

        self.click_element(AdminTicketManagementLocator.low_response_time_hour, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.low_response_time_hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.low_response_time_hour, doc)
        self.send_keys(AdminTicketManagementLocator.low_response_time_hour, 1,doc)

        self.click_element(AdminTicketManagementLocator.low_response_time_min, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.low_response_time_min, doc)
        self.keyboard_event(AdminTicketManagementLocator.low_response_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.low_response_time_min, 1,doc)

        self.click_element(AdminTicketManagementLocator.low_processing_time_day, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.low_processing_time_day, doc)
        self.keyboard_event(AdminTicketManagementLocator.low_processing_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.low_processing_time_day, 1,doc)

        self.click_element(AdminTicketManagementLocator.low_processing_time_hour, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.low_processing_time_hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.low_processing_time_hour, doc)
        self.send_keys(AdminTicketManagementLocator.low_processing_time_hour, 1,doc)

        self.click_element(AdminTicketManagementLocator.low_processing_time_min, doc)
        self.keyboard_event_all_select(AdminTicketManagementLocator.low_processing_time_min, doc)
        self.keyboard_event(AdminTicketManagementLocator.low_processing_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.low_processing_time_min, 1,doc)

        self.wait_elevisble(AdminTicketManagementLocator.submit_button, doc)
        self.click_element(AdminTicketManagementLocator.submit_button, doc)
        time.sleep(2)
        self.wait_elevisble(AdminTicketManagementLocator.high_response_time, doc)
        result = self.get_element(AdminTicketManagementLocator.high_response_time, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.high_processing_time, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.medium_response_time, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.medium_processing_time, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.low_response_time, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.low_processing_time, doc).text
        self.check_edit_aos_result(result)

    def check_edit_aos_result(self,result):
        timeList = result.split(' ')
        #print(">>>>>>>>>>>>>>>>>>>>>>", timeList)
        assert timeList[0] == "1"
        assert timeList[2] == "1"
        assert timeList[4] == "1"

    # 编辑SLA-Based notification
    def eidt_sbn(self):
        self.enter_ticket_management_page()
        time.sleep(2)
        doc = "编辑SLA-Based notification"
        self.wait_elevisble(AdminTicketManagementLocator.sbn_tab, doc)
        self.click_element(AdminTicketManagementLocator.sbn_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)
        #修改Notify Ticket Assigner
        self.wait_elevisble(AdminTicketManagementLocator.nta_high_day,doc)
        self.delete_text(AdminTicketManagementLocator.nta_high_day,doc)
        self.send_keys(AdminTicketManagementLocator.nta_high_day,1,doc)
        self.delete_text(AdminTicketManagementLocator.nta_high_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nta_high_hour, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nta_high_min, doc)
        self.send_keys(AdminTicketManagementLocator.nta_high_min, 1, doc)

        self.delete_text(AdminTicketManagementLocator.nta_medium_day, doc)
        self.send_keys(AdminTicketManagementLocator.nta_medium_day, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nta_medium_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nta_medium_hour, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nta_medium_min, doc)
        self.send_keys(AdminTicketManagementLocator.nta_medium_min, 1, doc)

        self.delete_text(AdminTicketManagementLocator.nta_low_day, doc)
        self.send_keys(AdminTicketManagementLocator.nta_low_day, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nta_low_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nta_low_hour, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nta_low_min, doc)
        self.send_keys(AdminTicketManagementLocator.nta_low_min, 1, doc)

        self.delete_text(AdminTicketManagementLocator.nta_ticket_amount_limitation,doc)
        self.send_keys(AdminTicketManagementLocator.nta_ticket_amount_limitation,11,doc)
        self.delete_text(AdminTicketManagementLocator.nta_frequency,doc)
        self.send_keys(AdminTicketManagementLocator.nta_frequency,10,doc)

        #修改Notify Support Member
        self.delete_text(AdminTicketManagementLocator.nsm_high_day, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_high_day, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_high_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_high_hour, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_high_min, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_high_min, 1, doc)

        self.delete_text(AdminTicketManagementLocator.nsm_medium_day, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_medium_day, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_medium_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_medium_hour, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_medium_min, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_medium_min, 1, doc)

        self.delete_text(AdminTicketManagementLocator.nsm_low_day, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_low_day, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_low_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_low_hour, 1, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_low_min, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_low_min, 1, doc)

        self.delete_text(AdminTicketManagementLocator.nsm_ticket_amount_limitation, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_ticket_amount_limitation, 11, doc)
        self.delete_text(AdminTicketManagementLocator.nsm_frequency, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_frequency, 10, doc)

        self.click_element(AdminTicketManagementLocator.submit_button, doc)
        time.sleep(2)

        self.wait_elevisble(AdminTicketManagementLocator.nta_high, doc)
        result = self.get_element(AdminTicketManagementLocator.nta_high, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.nta_medium, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.nta_low, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.nsm_high, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.nsm_medium, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.nsm_low, doc).text
        self.check_edit_aos_result(result)
        result = self.get_element(AdminTicketManagementLocator.nta_amount_limitation, doc).text
        assert result == "11"
        result = self.get_element(AdminTicketManagementLocator.nta_fre, doc).text
        print(">>>>>>>>>>>>>>>>>>>>>>",result)
        assert result == "10minutes"
        # result = self.get_element(AdminTicketManagementLocator.nsm_amount_limitation, doc).text
        # assert result == "11"
        result = self.get_element(AdminTicketManagementLocator.nsm_fre, doc).text
        assert result == "10minutes"

    # TL609088 | 关联性校验：优先设置Aging of SLA，再修改SLA-Based notification
    def relation_aos(self):
        self.enter_ticket_management_page()
        time.sleep(2)
        doc = "关联性校验：优先设置Aging of SLA"
        self.wait_elevisble(AdminTicketManagementLocator.aos_tab, doc)
        self.click_element(AdminTicketManagementLocator.aos_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)
        #将高优先级的response time改成1天
        self.wait_elevisble(AdminTicketManagementLocator.high_response_time_day, doc)
        self.delete_text(AdminTicketManagementLocator.high_response_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.high_response_time_day, 1, doc)
        #将高优先级的processing time改成1天
        self.delete_text(AdminTicketManagementLocator.high_processing_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.high_processing_time_day, 1, doc)
        #保存
        self.wait_elevisble(AdminTicketManagementLocator.submit_button, doc)
        self.click_element(AdminTicketManagementLocator.submit_button, doc)
        time.sleep(2)
        doc = "关联性校验：再修改SLA-Based notification"
        self.wait_elevisble(AdminTicketManagementLocator.sbn_tab, doc)
        self.click_element(AdminTicketManagementLocator.sbn_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)
        # 修改Notify Ticket Assigner
        self.wait_elevisble(AdminTicketManagementLocator.nta_high_day, doc)
        self.delete_text(AdminTicketManagementLocator.nta_high_day, doc)
        self.send_keys(AdminTicketManagementLocator.nta_high_day, 2, doc)
        time.sleep(1)
        self.wait_elevisble(AdminTicketManagementLocator.nta_high_error,doc)
        error = self.get_element(AdminTicketManagementLocator.nta_high_error,doc).text
        assert error == "Cannot be greater than the response time set in the 'Aging of SLA'."
        self.delete_text(AdminTicketManagementLocator.nsm_high_day, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_high_day, 2, doc)
        self.wait_elevisble(AdminTicketManagementLocator.nsm_gigh_error,doc)
        error = self.get_element(AdminTicketManagementLocator.nsm_gigh_error, doc).text
        assert error == "Cannot be greater than the processing time set in the 'Aging of SLA'."

    #TL609091 | 关联性校验：优先SLA-Based notification设置，再修改Aging of SLA
    def relation_sbn(self):
        self.enter_ticket_management_page()
        time.sleep(2)
        doc = "关联性校验：优先SLA-Based notification设置"
        self.wait_elevisble(AdminTicketManagementLocator.sbn_tab, doc)
        self.click_element(AdminTicketManagementLocator.sbn_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)
        # 修改Notify Ticket Assigner
        self.wait_elevisble(AdminTicketManagementLocator.nta_high_day, doc)
        self.delete_text(AdminTicketManagementLocator.nta_high_day, doc)
        self.send_keys(AdminTicketManagementLocator.nta_high_day, 1, doc)
        # 修改Notify Support Member
        self.delete_text(AdminTicketManagementLocator.nsm_high_day, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_high_day, 1, doc)
        #保存
        self.wait_elevisble(AdminTicketManagementLocator.submit_button, doc)
        self.click_element(AdminTicketManagementLocator.submit_button, doc)
        time.sleep(2)
        doc = "关联性校验：再修改Aging of SLA"
        self.wait_elevisble(AdminTicketManagementLocator.aos_tab, doc)
        self.click_element(AdminTicketManagementLocator.aos_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)
        #修改高优先级响应时间
        self.wait_elevisble(AdminTicketManagementLocator.high_response_time_day, doc)
        self.delete_text(AdminTicketManagementLocator.high_response_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.high_response_time_day, 0, doc)
        time.sleep(1)
        self.wait_elevisble(AdminTicketManagementLocator.high_response_time_error,doc)
        error = self.get_element(AdminTicketManagementLocator.high_response_time_error,doc).text
        assert error == "Cannot be smaller than the time set in the '[SLA- based Notification]- Notify Ticket Assigner'"
        self.delete_text(AdminTicketManagementLocator.high_processing_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.high_processing_time_day, 0, doc)
        self.wait_elevisble(AdminTicketManagementLocator.high_processing_time_error,doc)
        error = self.get_element(AdminTicketManagementLocator.high_processing_time_error, doc).text
        assert error == "Cannot be smaller than the time set in the '[SLA- based Notification]- Notify Support Member'"

    def edit_medium_ticket_solving_time(self,day,hour,minute):
        doc = "修改工单的处理时间"
        self.wait_elevisble(AdminTicketManagementLocator.ticket_management_tab, doc)
        self.click_element(AdminTicketManagementLocator.ticket_management_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.sbn_tab, doc)
        self.click_element(AdminTicketManagementLocator.sbn_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)

        self.keyboard_event(AdminTicketManagementLocator.nsm_medium_day, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_medium_day, 0, doc)
        self.keyboard_event(AdminTicketManagementLocator.nsm_medium_hour, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_medium_hour, 0, doc)
        self.keyboard_event(AdminTicketManagementLocator.nsm_medium_min, doc)
        self.send_keys(AdminTicketManagementLocator.nsm_medium_min, 1, doc)

        self.click_element(AdminTicketManagementLocator.submit_button, doc)
        time.sleep(2)
        self.wait_elevisble(AdminTicketManagementLocator.aos_tab, doc)
        self.click_element(AdminTicketManagementLocator.aos_tab, doc)
        self.wait_elevisble(AdminTicketManagementLocator.edit_button, doc)
        self.click_element(AdminTicketManagementLocator.edit_button, doc)

        self.keyboard_event(AdminTicketManagementLocator.medium_processing_time_day, doc)
        self.send_keys(AdminTicketManagementLocator.medium_processing_time_day, day, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_processing_time_hour, doc)
        self.send_keys(AdminTicketManagementLocator.medium_processing_time_hour, hour, doc)
        self.keyboard_event(AdminTicketManagementLocator.medium_processing_time_min, doc)
        self.send_keys(AdminTicketManagementLocator.medium_processing_time_min, minute, doc)
        self.wait_elevisble(AdminTicketManagementLocator.submit_button, doc)
        self.click_element(AdminTicketManagementLocator.submit_button, doc)
        time.sleep(2)